package pw.hais.etgsh.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

import pw.hais.app.AppAdapter;
import pw.hais.etgsh.R;
import pw.hais.etgsh.model.DianTaiTypeModel;

/**
 * 菜单列表
 * Created by Hais1992 on 2015/12/14.
 */
public class DianTaiListAdapter extends AppAdapter<DianTaiTypeModel, DianTaiListAdapter.ViewHolder> {


    public DianTaiListAdapter(List<DianTaiTypeModel> mList) {
        super(mList, R.layout.activity_article_list_item, ViewHolder.class);
    }

    @Override
    public void onBindView(int position, ViewHolder mViewHolder, DianTaiTypeModel mItem) {

//        mViewHolder.image_image.setVisibility(View.GONE);
        mViewHolder.text_title.setText(mItem.title + "");
        mViewHolder.text_content.setText(mItem.content + "...");
        mViewHolder.text_ct.setText("来源：网络收集");

    }

    //反射免FindViewById，名称必须和 XML的 控件ID一样
    public static class ViewHolder extends AppAdapter.ViewHolder {
        public TextView text_title;
        public TextView text_content;
        public TextView text_ct;
        public ImageView image_btn_share;
        public ImageView image_image;
    }
}
